<script setup>
import { Search, Upload } from '@element-plus/icons-vue'
import { useSubjectStore } from '@/stores'
import { ref } from 'vue'
const subjectStore = useSubjectStore()
subjectStore.getList()
const search = ref('')
const loading = ref(false)
const annex = ref(false)
const general = ref(false)
const isMenstruation = ref(false)
const subject = ref({})
const issubject = ref(false)
const is = ref(true)
is.value = subjectStore.is
const addsubject = (data) => {
  subjectStore.addSubject(data).then((code) => {
    if (code) {
      subjectStore.list[subjectStore.list.length] = data
      subject.value = {}
    }
  })
}
const otherTwo = ref({})
const addotherTwo = (data) => {
  subjectStore.addOtherTwo(data).then((code) => {
    if (code) {
      subjectStore.otherTwo[subjectStore.otherTwo.length] = data
      otherTwo.value = {}
    }
  })
}
const setotherTwo = (data) => {
  subjectStore.setOtherTwo(data).then((code) => {
    if (code) {
      console.log(code)
    }
  })
}
const delotherTwo = (data, index) => {
  subjectStore.delOtherTwo(data).then((code) => {
    if (code) {
      subjectStore.otherTwo.splice(index, 1)
    }
  })
}
const setAll = (close) => {
  subjectStore.setGeneral(subjectStore.general)
  subjectStore.setSmoke(subjectStore.smoke)
  subjectStore.setDrink(subjectStore.drink)
  subjectStore.setInducing(subjectStore.inducing)
  subjectStore.setVital(subjectStore.vital)
  subjectStore.setAllergy(subjectStore.allergy)
  subjectStore.setDisease(subjectStore.disease)
  subjectStore.setAdFamily(subjectStore.adFamily)
  subjectStore.setTreatment(subjectStore.treatment)
  subjectStore.setSystem(subjectStore.system)
  subjectStore.setOral(subjectStore.oral)
  subjectStore.setTopical(subjectStore.topical)
  subjectStore.setOtherOne(subjectStore.otherOne)
  ElMessage.success('成功')
  close()
}
const setId = ({ id, sex }) => {
  otherTwo.value.id = id
  subjectStore.setId(id)
  subjectStore.getExperimental(id)
  subjectStore.getAE(id)
  subjectStore.getSAE(id)
  subjectStore.getCompletion(id)
  subjectStore.getEliminate(id)
  subjectStore.getExit(id)
  subjectStore.getSuspend(id)
  subjectStore.getEasi(id)
  subjectStore.getAdverse(id)
  subjectStore.getRecrudescence(id)
  subjectStore.getFactors(id)
  if (sex === '女') {
    isMenstruation.value = true
    subjectStore.getMenstruation(id)
  } else {
    isMenstruation.value = false
  }
  subjectStore.getGeneral(id)
  subjectStore.getSmoke(id)
  subjectStore.getDrink(id)
  subjectStore.getInducing(id)
  subjectStore.getVital(id)
  subjectStore.getAllergy(id)
  subjectStore.getDisease(id)
  subjectStore.getAdFamily(id)
  subjectStore.getTreatment(id)
  subjectStore.getSystem(id)
  subjectStore.getOral(id)
  subjectStore.getTopical(id)
  subjectStore.getOtherOne(id)
  subjectStore.getOtherTwo(id)
  subjectStore.getExperimental(id)
}
const addsearch = async (data) => {
  loading.value = true
  if (data.length === 0) {
    await subjectStore.getList()
  } else {
    await subjectStore.searchList(data)
  }
  loading.value = false
}
</script>
<template>
  <div v-if="!is">
    <el-input
      style="width: 200px; margin-right: 10px"
      v-model="search"
      :prefix-icon="Search"
    ></el-input>
    <el-button @click="addsearch(search)">搜索</el-button>
  </div>
  <el-card class="page-container">
    <div v-if="is" class="header">
      <span>受试者信息</span>
      <div>
        <el-input
          style="width: 200px; margin-right: 10px"
          v-model="search"
          :prefix-icon="Search"
        ></el-input>
        <el-button @click="addsearch(search)">搜索</el-button>
      </div>
    </div>
    <div v-if="!is">
      <el-button
        @click="issubject === true ? (issubject = false) : (issubject = true)"
      >
        添加
      </el-button>
    </div>
    <el-table :data="[1]" v-if="issubject">
      <el-table-column>
        <template #default>
          <el-input v-model="subject.name" />
        </template>
      </el-table-column>
      <el-table-column>
        <template #default>
          <el-input v-model="subject.sex" />
        </template>
      </el-table-column>
      <el-table-column>
        <template #default>
          <el-input v-model="subject.id" />
        </template>
      </el-table-column>
      <el-table-column>
        <template #default>
          <el-input v-model="subject.phone" />
        </template>
      </el-table-column>
      <el-table-column>
        <template #default>
          <el-input v-model="subject.address" />
        </template>
      </el-table-column>
      <el-table-column>
        <template #default>
          <el-input v-model="subject.contactName" />
        </template>
      </el-table-column>
      <el-table-column>
        <template #default>
          <el-input v-model="subject.contactPhone" />
        </template>
      </el-table-column>
      <el-table-column>
        <el-button @click="addsubject(subject)"> 添加 </el-button>
      </el-table-column>
    </el-table>
    <el-table
      v-loading="loading"
      @row-click="setId"
      :data="subjectStore.list"
      stripe
    >
      <el-table-column prop="name" label="姓名" />
      <el-table-column prop="sex" label="性别" />
      <el-table-column prop="id" label="身份证" />
      <el-table-column prop="phone" label="电话" />
      <el-table-column prop="address" label="家庭地址" />
      <el-table-column prop="contactName" label="联系人姓名" />
      <el-table-column prop="contactPhone" label="联系人电话" />
      <el-table-column label="编辑">
        <el-link
          :underline="false"
          @click="general = true"
          style="margin-right: 10px"
          >详细信息</el-link
        >
        <el-link :underline="false" @click="annex = true">附件</el-link>
      </el-table-column>
    </el-table>
  </el-card>
  <el-dialog
    v-model="annex"
    v-if="annex"
    title="受试者附件"
    destroy-on-close
    width="70%"
    @close="() => (annex = false)"
  >
    <el-menu
      mode="horizontal"
      active-text-color="#ffd04b"
      :default-active="$route.path"
      router
    >
      <el-menu-item index="/subjects/list/experimental">
        试验指征表
      </el-menu-item>
      <el-menu-item index="/subjects/list/adverse">
        不良反应记录表
      </el-menu-item>
      <el-menu-item index="/subjects/list/recrudescence"> 随访表 </el-menu-item>
      <el-menu-item index="/subjects/list/completion"
        >临床试验完成表
      </el-menu-item>
      <el-menu-item index="/subjects/list/ae">不良事件（AE）表 </el-menu-item>
      <el-menu-item index="/subjects/list/sae">
        严重不良事件（SAE）表
      </el-menu-item>
    </el-menu>
    <router-view></router-view>
  </el-dialog>
  <el-drawer v-model="general" size="80%" @close="() => (general = false)">
    <template #header="{ close, titleId, titleClass }">
      <div style="display: flex; justify-content: space-between">
        <h4 :id="titleId" :class="titleClass">详细信息</h4>
        <el-button @click="setAll(close)" style="margin: auto 0">
          <el-icon style="margin-right: 10px"><Upload /></el-icon>
          提交
        </el-button>
      </div>
    </template>
    <el-scrollbar>
      <el-row>
        <h4>一般资料</h4>
      </el-row>
      <el-row>
        <el-col :span="12">
          <span>出生日期:</span>
          <el-date-picker
            v-model="subjectStore.general.birthDate"
            type="date"
            placeholder="出生日期"
            style="width: 120px"
          />
        </el-col>
        <el-col :span="12">
          <span>年龄:</span>
          <el-input-number
            v-model="subjectStore.general.age"
            :min="1"
            :max="150"
            style="width: 120px"
          />
        </el-col>
      </el-row>
      <el-row>
        <el-col>
          <span>民族:</span>
          <el-radio-group v-model="subjectStore.general.nation">
            <el-radio value="汉">汉</el-radio>
            <el-radio value="其他">其他</el-radio>
          </el-radio-group>
        </el-col>
      </el-row>
      <el-row>
        <el-col>
          <span>婚姻:</span>
          <el-radio-group v-model="subjectStore.general.marriage">
            <el-radio value="1">未婚</el-radio>
            <el-radio value="2">已婚</el-radio>
            <el-radio value="3">丧偶</el-radio>
            <el-radio value="4">离婚</el-radio>
            <el-radio value="5">其他</el-radio>
          </el-radio-group>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="12">
          <span>身高:</span>
          <el-input-number
            v-model="subjectStore.general.height"
            :min="1"
            :max="250"
            style="width: 120px"
          />
          <span>cm</span>
        </el-col>
        <el-col :span="12">
          <span>体重:</span>
          <el-input-number
            v-model="subjectStore.general.weight"
            :min="1"
            :max="500"
            style="width: 120px"
          />
          <span>kg</span>
        </el-col>
      </el-row>
      <el-row>
        <el-col>
          <span>文化程度:</span>
          <el-radio-group v-model="subjectStore.general.education">
            <el-radio value="1">未上学</el-radio>
            <el-radio value="2">小学</el-radio>
            <el-radio value="3">初中</el-radio>
            <el-radio value="4">高中</el-radio>
            <el-radio value="5">大专及以上</el-radio>
            <el-radio value="6">不详</el-radio>
          </el-radio-group>
        </el-col>
      </el-row>
      <el-row>
        <el-col>
          <span>职业:</span>
          <el-radio-group v-model="subjectStore.general.career">
            <el-radio value="1">工人</el-radio>
            <el-radio value="2">农民</el-radio>
            <el-radio value="3">学生</el-radio>
            <el-radio value="4">干部</el-radio>
            <el-radio value="5">专业技术人员</el-radio>
            <el-radio value="6">离退休</el-radio>
            <el-radio value="7">自由职业者</el-radio>
            <el-radio value="8">其他</el-radio>
          </el-radio-group>
        </el-col>
      </el-row>
      <el-row>
        <el-col>
          <span>长期居住地:</span>
          <el-input
            v-model="subjectStore.general.longTermResidence"
            placeholder="地址"
            style="width: 280px"
          />
        </el-col>
      </el-row>
      <el-row>
        <el-col>
          <span>环境:</span>
          <el-radio-group v-model="subjectStore.general.environment">
            <el-radio value="1">潮湿</el-radio>
            <el-radio value="2">干燥</el-radio>
            <el-radio value="3">高温</el-radio>
            <el-radio value="4">寒冷</el-radio>
          </el-radio-group>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="8">
          <span>吸烟史:</span>
          <el-radio-group v-model="subjectStore.general.isSmoke">
            <el-radio :value="0">无</el-radio>
            <el-radio :value="1">有</el-radio>
          </el-radio-group>
        </el-col>
        <template v-if="subjectStore.general.isSmoke">
          <el-col :span="8">
            <span>吸烟量</span>
            <el-input-number
              v-model="subjectStore.smoke.branch"
              :min="0"
              :max="1000"
            />
            <span>支/天</span>
          </el-col>
          <el-col :span="8">
            <span>吸烟时间</span>
            <el-input-number
              v-model="subjectStore.smoke.year"
              :min="0"
              :max="150"
            />
            <span>年</span>
          </el-col>
        </template>
      </el-row>
      <el-row>
        <el-col :span="8">
          <span>饮酒史:</span>
          <el-radio-group v-model="subjectStore.general.isDrink">
            <el-radio :value="0">无</el-radio>
            <el-radio :value="1">有</el-radio>
          </el-radio-group>
        </el-col>
        <template v-if="subjectStore.general.isDrink">
          <el-col :span="8">
            <span>饮酒量</span>
            <el-input-number
              v-model="subjectStore.drink.volumeDaily"
              :min="0"
              :max="1000"
            />
            <span>量/天</span>
          </el-col>
          <el-col :span="8">
            <span>饮酒时间</span>
            <el-input-number
              v-model="subjectStore.drink.year"
              :min="0"
              :max="150"
            />
            <span>年</span>
          </el-col>
        </template>
      </el-row>
      <el-row>
        <el-col>
          <span>饮食习惯:</span>
          <el-radio-group v-model="subjectStore.general.eatingHabits">
            <el-radio value="1">喜食肥甘厚味</el-radio>
            <el-radio value="2">喜食辛辣</el-radio>
            <el-radio value="3">喜食生冷</el-radio>
            <el-radio value="4">其他</el-radio>
          </el-radio-group>
        </el-col>
      </el-row>
      <el-row v-if="isMenstruation">
        <el-col>
          <span>月经史</span>
          <el-radio-group v-model="subjectStore.menstruation.menstruation">
            <el-radio value="0" style="margin-right: 0px">未绝经</el-radio>
            <el-radio value="1">已绝经</el-radio>
          </el-radio-group>
        </el-col>
        <el-col :span="20" style="display: flex; flex-direction: column">
          <div style="line-height: 32px; margin-top: 19.2px">
            <span>初潮</span>
            <el-input-number
              v-model="subjectStore.menstruation.menarcheYear"
              :min="0"
              :max="150"
              style="width: 110px"
            />
            <span>周岁 行</span>
            <el-input-number
              v-model="subjectStore.menstruation.lingDay"
              :min="0"
              :max="30"
              style="width: 100px"
            />
            <span>天 周期</span>
            <el-input-number
              v-model="subjectStore.menstruation.cycle"
              :min="0"
              :max="100"
              style="width: 110px"
            />
            <span>天 末次月经:</span>
            <el-date-picker
              v-model="subjectStore.menstruation.lastMenstruation"
              type="date"
              placeholder="末次月经"
            />
          </div>
          <div style="line-height: 32px">
            <span>绝经年龄</span>
            <el-input-number
              v-model="subjectStore.menstruation.menopausalAge"
              :min="0"
              :max="150"
            />
            <span>周岁</span>
          </div>
        </el-col>
      </el-row>
      <el-row>
        <el-col>
          <span>诱发或加重因素：</span>
          <el-checkbox v-model="subjectStore.inducing.fatigue" label="疲劳" />
          <el-checkbox v-model="subjectStore.inducing.diet" label="饮食" />
          <el-checkbox v-model="subjectStore.inducing.infect" label="感染" />
          <el-checkbox
            v-model="subjectStore.inducing.menstruation"
            label="月经"
          />
          <el-checkbox v-model="subjectStore.inducing.medicine" label="药物" />
          <el-checkbox
            v-model="subjectStore.inducing.season"
            label="季节变化"
          />
          <el-checkbox
            v-model="subjectStore.inducing.traumaSurgery"
            label="外伤手术"
          />
          <el-checkbox
            v-model="subjectStore.inducing.spirit"
            label="精神因素"
          />
          <el-checkbox v-model="subjectStore.inducing.other" label="其他" />
        </el-col>
      </el-row>
      <hr />
      <el-row>
        <h4>生命体征</h4>
      </el-row>
      <el-row>
        <el-col :span="12">
          <span>体温</span>
          <el-input-number
            v-model="subjectStore.vital.temperature"
            :precision="1"
            :step="0.1"
            :min="30"
            :max="50"
            style="width: 120px"
          />
          <span>°C</span>
        </el-col>
        <el-col :span="12">
          <span>呼吸</span>
          <el-input-number
            v-model="subjectStore.vital.breathing"
            :min="0"
            :max="150"
            style="width: 120px"
          />
          <span>次/分</span>
        </el-col>
        <el-col :span="12">
          <span>心率</span>
          <el-input-number
            v-model="subjectStore.vital.heartRate"
            :min="0"
            :max="500"
            style="width: 120px"
          />
          <span>次/分</span>
        </el-col>
        <el-col :span="12">
          <span>血压</span>
          <el-input-number
            v-model="subjectStore.vital.bloodPressure"
            :min="0"
            :max="400"
            style="width: 120px"
          />
          <span>mmHg</span>
        </el-col>
      </el-row>
      <hr />
      <el-row>
        <h4>过敏史</h4>
      </el-row>
      <el-row>
        <el-col>
          <span>药物过敏:</span>
          <el-radio-group v-model="subjectStore.allergy.medicineAllergy">
            <el-radio :value="0">无</el-radio>
            <el-radio :value="1">有</el-radio>
          </el-radio-group>
          <el-input
            v-model="subjectStore.allergy.medicine"
            v-if="subjectStore.allergy.medicineAllergy"
            placeholder="过敏药物"
            style="width: 300px; margin-left: 30px"
          />
        </el-col>
      </el-row>
      <el-row>
        <el-col>
          <span>食物过敏:</span>
          <el-radio-group v-model="subjectStore.allergy.foodAllergy">
            <el-radio :value="0">无</el-radio>
            <el-radio :value="1">有</el-radio>
          </el-radio-group>
          <el-input
            v-if="subjectStore.allergy.foodAllergy"
            v-model="subjectStore.allergy.food"
            placeholder="过敏食物"
            style="width: 300px; margin-left: 30px"
          />
        </el-col>
      </el-row>
      <el-row>
        <el-col>
          <span>接触过敏:</span>
          <el-radio-group v-model="subjectStore.allergy.contactAllergy">
            <el-radio :value="0">无</el-radio>
            <el-radio :value="1">有</el-radio>
          </el-radio-group>
          <el-input
            v-if="subjectStore.allergy.contactAllergy"
            v-model="subjectStore.allergy.contact"
            placeholder="过敏接触物"
            style="width: 300px; margin-left: 30px"
          />
        </el-col>
      </el-row>
      <hr />
      <el-row>
        <h4>疾病史</h4>
      </el-row>
      <el-row>
        <el-col>
          <span>AD发病史: 首次发病</span>
          <el-date-picker
            v-model="subjectStore.disease.firstDisease"
            type="month"
            placeholder="首次发病"
            style="width: 130px"
          />
          <span> 病程:</span>
          <el-input
            v-model="subjectStore.disease.diseaseCourse"
            style="width: 100px"
            placeholder="几年或几月"
          />
          <span>发病部位:</span>
          <el-input v-model="subjectStore.disease.site" style="width: 100px" />
          <span>好发时间:</span>
          <el-radio-group v-model="subjectStore.disease.season">
            <el-radio value="1">春</el-radio>
            <el-radio value="2">夏</el-radio>
            <el-radio value="3">秋</el-radio>
            <el-radio value="4">冬</el-radio>
          </el-radio-group>
        </el-col>
      </el-row>
      <el-row>
        <el-row>
          <span>AD家族史:</span>
          <el-radio-group v-model="subjectStore.disease.isAdFamilyHistory">
            <el-radio :value="0">无</el-radio>
            <el-radio :value="1">有,请填:</el-radio>
          </el-radio-group>
        </el-row>
      </el-row>
      <div v-if="subjectStore.disease.isAdFamilyHistory">
        <el-row>
          <el-col>
            <span>一级</span>
            <el-checkbox v-model="subjectStore.adFamily.parent" label="父母" />
            <el-checkbox
              v-model="subjectStore.adFamily.twin"
              label="孪生(单卵双卵)"
            />
            <el-checkbox
              v-model="subjectStore.adFamily.sibling"
              label="兄弟姐妹"
            />
            <el-checkbox
              v-model="subjectStore.adFamily.children"
              label="子女"
            />
          </el-col>
        </el-row>
        <el-row>
          <el-col>
            <span>二级</span>
            <el-checkbox
              v-model="subjectStore.adFamily.grandparent"
              label="祖父母"
            />
            <el-checkbox
              v-model="subjectStore.adFamily.grandparents"
              label="外祖父母"
            />
            <el-checkbox
              v-model="subjectStore.adFamily.uncleAunt"
              label="叔伯姑"
            />
            <el-checkbox
              v-model="subjectStore.adFamily.auntieUncle"
              label="姨舅"
            />
            <el-checkbox v-model="subjectStore.adFamily.nephew" label="侄甥" />
            <el-checkbox
              v-model="subjectStore.adFamily.grandson"
              label="孙子"
            />
            <el-checkbox
              v-model="subjectStore.adFamily.grandchild"
              label="外孙"
            />
          </el-col>
        </el-row>
        <el-row>
          <el-col>
            <span>三级</span>
            <el-checkbox
              v-model="subjectStore.adFamily.fristCousins"
              label="堂兄弟姐妹"
            />
            <el-checkbox
              v-model="subjectStore.adFamily.distantCousins"
              label="表兄弟姐妹"
            />
          </el-col>
        </el-row>
      </div>
      <hr />
      <el-row>
        <el-col>
          <h3>
            <span>既往一个月的治疗史</span>
            <el-radio-group v-model="subjectStore.general.isMedicine">
              <el-radio :value="0">无</el-radio>
              <el-radio :value="1">有,请填下表:</el-radio>
            </el-radio-group>
          </h3>
        </el-col>
      </el-row>
      <div v-if="subjectStore.general.isMedicine">
        <el-row>
          <el-col>
            <div>
              <span>系统药物</span>
              <el-radio-group v-model="subjectStore.treatment.isSystemMedicine">
                <el-radio :value="0">无</el-radio>
                <el-radio :value="1">有,请选择:</el-radio>
              </el-radio-group>
            </div>
            <div
              v-if="subjectStore.treatment.isSystemMedicine"
              style="margin-left: 76px"
            >
              <el-checkbox
                v-model="subjectStore.system.sodiumThiosulfate"
                label="硫代硫酸钠"
              />
              <el-checkbox
                v-model="subjectStore.system.calciumSupplementsVitaminC"
                label="钙剂和维生素C"
              />
              <el-checkbox
                v-model="
                  subjectStore.system.compoundGlycyrrhetinicAcidGlycoside
                "
                label="复方甘草酸苷"
              />
              <el-checkbox
                v-model="subjectStore.system.isHormone"
                label="激素"
              />
              <el-input
                v-if="subjectStore.system.isHormone"
                v-model="subjectStore.system.hormon"
                style="width: 150px; padding-right: 10px"
                placeholder="激素"
              />
              <el-checkbox
                v-model="subjectStore.system.isBiologicalAgents"
                label="生物制剂"
              />
              <el-input
                v-if="subjectStore.system.isBiologicalAgents"
                v-model="subjectStore.system.biologicalAgents"
                style="width: 150px"
                placeholder="生物制剂"
              />
            </div>
          </el-col>
        </el-row>
        <el-row>
          <el-col>
            <div>
              <span>口服药物</span>
              <el-radio-group v-model="subjectStore.treatment.isOralMedicine">
                <el-radio :value="0">无</el-radio>
                <el-radio :value="1">有,请选择:</el-radio>
              </el-radio-group>
            </div>
            <div
              v-if="subjectStore.treatment.isOralMedicine"
              style="margin-left: 76px"
            >
              <el-checkbox
                v-model="subjectStore.oral.isAntihistamines"
                label="抗组胺药"
              />
              <el-input
                v-if="subjectStore.oral.isAntihistamines"
                v-model="subjectStore.oral.antihistamines"
                style="width: 150px; padding-right: 10px"
                placeholder="抗组胺药"
              />
              <el-checkbox v-model="subjectStore.oral.isHormone" label="激素" />
              <el-input
                v-if="subjectStore.oral.isHormone"
                v-model="subjectStore.oral.hormone"
                style="width: 150px; padding-right: 10px"
                placeholder="激素"
              />
              <el-checkbox
                v-model="subjectStore.oral.isImmunosuppressant"
                label="免疫抑制剂"
              />
              <el-input
                v-if="subjectStore.oral.isImmunosuppressant"
                v-model="subjectStore.oral.immunosuppressant"
                style="width: 150px"
                placeholder="免疫抑制剂"
              />
            </div>
          </el-col>
        </el-row>
        <el-row>
          <el-col>
            <div>
              <span>外用药物</span>
              <el-radio-group
                v-model="subjectStore.treatment.isTopicalMedicine"
              >
                <el-radio :value="0">无</el-radio>
                <el-radio :value="1">有,请选择:</el-radio>
              </el-radio-group>
            </div>
            <div
              v-if="subjectStore.treatment.isTopicalMedicine"
              style="margin-left: 76px"
            >
              <el-checkbox
                v-model="subjectStore.topical.isHormone"
                label="激素"
              />
              <el-input
                v-if="subjectStore.topical.isHormone"
                v-model="subjectStore.topical.hormone"
                style="width: 150px; padding-right: 10px"
                placeholder="激素"
              />
              <el-checkbox
                v-model="subjectStore.topical.isImmunosuppressant"
                label="免疫抑制剂"
              />
              <el-input
                v-if="subjectStore.topical.isImmunosuppressant"
                v-model="subjectStore.topical.immunosuppressant"
                style="width: 150px"
                placeholder="免疫抑制剂"
              />
              <el-checkbox
                v-model="subjectStore.topical.isOther"
                label="其他"
              />
              <el-input
                v-if="subjectStore.topical.isOther"
                v-model="subjectStore.topical.other"
                style="width: 150px; padding-right: 10px"
                placeholder="其他"
              />
            </div>
          </el-col>
        </el-row>
        <el-row>
          <el-col>
            <span>物理疗法</span>
            <el-radio-group v-model="subjectStore.treatment.isPhysical">
              <el-radio :value="0">无</el-radio>
              <el-radio :value="1">有,请选择:</el-radio>
            </el-radio-group>
            <el-input
              v-if="subjectStore.treatment.isPhysical"
              v-model="subjectStore.treatment.physical"
              style="width: 150px; padding-right: 10px"
              placeholder="其他"
            />
          </el-col>
        </el-row>
      </div>
      <hr />
      <el-row>
        <el-col>
          <h3>
            <span>既往史其他疾病及治疗史</span>
            <el-radio-group v-model="subjectStore.treatment.isOtherDiseaseOne">
              <el-radio :value="0">无</el-radio>
              <el-radio :value="1">有,请填下表:</el-radio>
            </el-radio-group>
          </h3>
        </el-col>
      </el-row>
      <div v-if="subjectStore.treatment.isOtherDiseaseOne">
        <el-row>
          <el-col :span="5">
            <span>高血压</span>
            <el-radio-group v-model="subjectStore.otherOne.isHypertension">
              <el-radio :value="0">无</el-radio>
              <el-radio :value="1">有</el-radio>
            </el-radio-group>
          </el-col>
          <el-col :span="19" v-if="subjectStore.otherOne.isHypertension">
            <span>病程:</span>
            <el-input
              v-model="subjectStore.otherOne.hypertensionDiseaseCourse"
              style="width: 150px; padding-right: 10px"
              placeholder="几年或几月"
            />
            <span> 最高血压:</span>
            <el-input-number
              v-model="subjectStore.otherOne.highestBloodPressure"
              :min="0"
              :max="300"
            />
            <span>mmHg</span>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="5">
            <span>糖尿病</span>
            <el-radio-group v-model="subjectStore.otherOne.isDiabetes">
              <el-radio :value="0">无</el-radio>
              <el-radio :value="1">有</el-radio>
            </el-radio-group>
          </el-col>
          <el-col :span="19" v-if="subjectStore.otherOne.isDiabetes">
            <span>病程:</span>
            <el-input
              v-model="subjectStore.otherOne.diabetesDiseaseCourse"
              style="width: 150px; padding-right: 10px"
              placeholder="几年或几月"
            />
          </el-col>
        </el-row>
      </div>
      <hr />
      <el-row>
        <el-col>
          <h3>
            <span>其他疾病及治疗史</span>
            <el-radio-group v-model="subjectStore.treatment.isOtherDiseaseTwo">
              <el-radio :value="0">无</el-radio>
              <el-radio :value="1">有,请填下表:</el-radio>
            </el-radio-group>
          </h3>
        </el-col>
      </el-row>
      <div v-if="subjectStore.treatment.isOtherDiseaseTwo">
        <el-row>
          <el-col>
            <el-table :data="subjectStore.otherTwo" stripe>
              <el-table-column prop="diseaseName" label="疾病名称">
              </el-table-column>
              <el-table-column label="病程">
                <template #default="scope">
                  <el-input v-model="scope.row.diseaseCourse" />
                </template>
              </el-table-column>
              <el-table-column label="病情活动">
                <template #default="scope">
                  <el-input v-model="scope.row.diseaseActivity" />
                </template>
              </el-table-column>
              <el-table-column label="治疗">
                <template #default="scope">
                  <el-input v-model="scope.row.treat" />
                </template>
              </el-table-column>
              <el-table-column label="药物名称及其他措施">
                <template #default="scope">
                  <el-input v-model="scope.row.medicineNameAndOtherMeasures" />
                </template>
              </el-table-column>
              <el-table-column label="编辑">
                <template #default="scope">
                  <el-button @click="setotherTwo(scope.row)"> 确定 </el-button>
                  <el-button @click="delotherTwo(scope.row, scope.$index)">
                    删除
                  </el-button>
                </template>
              </el-table-column>
            </el-table>
            <el-table :data="[1]">
              <el-table-column>
                <template #default>
                  <el-input v-model="otherTwo.diseaseName" />
                </template>
              </el-table-column>
              <el-table-column>
                <template #default>
                  <el-input v-model="otherTwo.diseaseCourse" />
                </template>
              </el-table-column>
              <el-table-column>
                <template #default>
                  <el-input v-model="otherTwo.diseaseActivity" />
                </template>
              </el-table-column>
              <el-table-column>
                <template #default>
                  <el-input v-model="otherTwo.treat" />
                </template>
              </el-table-column>
              <el-table-column>
                <template #default>
                  <el-input v-model="otherTwo.medicineNameAndOtherMeasures" />
                </template>
              </el-table-column>
              <el-table-column>
                <el-button @click="addotherTwo(otherTwo)"> 添加 </el-button>
              </el-table-column>
            </el-table>
          </el-col>
        </el-row>
      </div>
    </el-scrollbar>
  </el-drawer>
</template>
<style lang="scss" scoped>
.page-container {
  min-height: 100%;
  box-sizing: border-box;
  .header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
  }
}
span {
  margin: 0 10px;
  line-height: 32px;
}
.el-row {
  flex-wrap: wrap;
}
</style>
